<?php
Route::group(['prefix' => 'auth'], function () {
    Route::post('token', 'Api\AuthController@token');
    Route::post('destroy', 'Api\AuthController@destroy')->middleware('api-auth');
});

Route::resource('user', 'Api\UserController');
Route::group(['prefix' => 'admin'], function () {
   Route::get('side/menu', 'Api\MenuController@sideMenu');
   Route::group(['prefix' => 'user'], function () {
       Route::resource('role', 'Api\Users\RoleController');
       Route::resource('permission', 'Api\Users\PermissionController');
       Route::get('list', 'Api\UserController@list');
   });
});

Route::group(['prefix' => 'file'], function () {
    Route::get('image/{md5}', 'Api\UploadController@readImage');
    Route::post('upload/image', 'Api\UploadController@uploadImage');
});
